function setRem() {
  const designWidth = 1920 // 设计稿的宽度
  const html = document.documentElement
  const clientWidth = html.clientWidth
  // console.log('clientWidth', clientWidth)

  const rem = (clientWidth * 100) / designWidth
  console.log('rem', rem)

  html.style.fontSize = `${rem}px`
}

window.addEventListener('resize', setRem)
document.addEventListener('DOMContentLoaded', setRem)
